import Vue from 'vue'
import "../assembly"

import App from './App'
import Conversation from "./pages/Conversation"
import Search from './pages/Search'
import Activity from './pages/Activity'
import Detail from './pages/Detail'
import Message from './pages/Message'
import Profile from './pages/Profile'
import Invite from './pages/Invite'
import CheckReady from './pages/CheckReady'
import Apply from './pages/Apply'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export const router = new VueRouter({
    hashbang: true,
    history: false,
    saveScrollPosition: true,
    transitionOnLoad: true,
    canReuse: true
})

router.map({
    '/': {
        name: 'activity',
        component: Activity
    },
    '/conversation/:conversationId': {
        name: 'Conversation',
        component: Conversation
    },
    '/search': {
        name: 'search',
        component: Search
    },
    '/detail/:postId':{
        name: 'detail',
        component: Detail
    },
    '/message': {
        name: 'message',
        component: Message
    },
    '/apply/:postId': {
        name:'apply',
        component:Apply
    },
    '/profile': {
        name: 'profile',
        component: Profile
    },
    '/invite/:postId': {
        name: 'invite',
        component: Invite
    },
    '/checkready/:postId': {
        name: 'checkReady',
        component: CheckReady
    }
})
/* eslint-disable no-new */

// router.beforeEach(function () {
//   window.scrollTo(0, 0)
// })
router.start(App, 'body')
// new Vue({
//     el: 'body',
//     components: { App }
// })
